#include <stdio.h>

int main() 
{
    float val = 0.0;
    val >= 1 && val <= 100000;
    int month = 0;
    int date = 0;
    int discount = 0;
    float price = 0.0;

    scanf("%f %d %d %d",&val,&month,&date,&discount);
    //先判断是否为双十一/双十二
    if (month == 11 && date == 11)
        price = 0.7 * val - discount * 50;
    else if (month == 12 && date == 12)
        price = 0.8 * val - discount * 50;
    //防止倒贴
    if (price < 0)
        printf("0.00\n");
    else
        printf("%.2f\n",price);

    return 0;
}